package com.malou.server.base;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class Conexion {
	private static SqlMapClient sqlMap;
	private Conexion(){}
	public static SqlMapClient getSqlMap(){
		if(sqlMap == null){
	        String resource = "com/malou/server/base/Conexion.xml";
	        Reader reader=null;
			try {
				reader = Resources.getResourceAsReader(resource);
			} catch (IOException e) {
				e.printStackTrace();
			}
	        sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
		}
        return sqlMap;
    }
	
	public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException(); 
	}
}